<template>
	<view>
		<view class="login_info" v-if="isLogin ==''">
			<view>您还没有登录?</view>
			<view>
				<button class="cu-btn bg-green" @click="submit">立即登录</button>
				<!-- <text class="cuIcon-close margin-left-sm"@click="isLogin='1'"></text> -->
			</view>
		</view>
		<!-- <view class="login"></view> -->
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default{
		props:{
			isLogin:{
				type:[String,String],
				default:''
			}
		},
		data(){
			return{
				
			}
		},
		computed:{
			...mapState(['isLoginNum'])
		},
		watch:{
			
		},
		methods:{
			submit() {
				
				uni.navigateTo({
					url:'/pages/login/login'
				})
				
				return
				wx.getUserProfile({
					desc: '用于完善会员资料', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
					success: (res) => {
						let obj = JSON.parse(res.rawData)
						let data = {
							username: obj.nickName,
							openid: uni.getStorageSync('openId'),
							avatar: obj.avatarUrl,
						}
						console.log('[用户信息]',data);
						this.$axios.axiosFrom('POST', openidlogin, data)
							.then(res => {
								if (res.code == 1) {
									uni.setStorageSync('userInfo', res.data.userinfo)
									uni.setStorageSync('token', res.data.userinfo.token)
									uni.setStorageSync('isLogin', true)
									this.isLogin = true
									this.$tools.showToast('登陆成功')
									console.log('[成功]',res);
								} else {
									this.$tools.showToast(res.msg)
									console.log('[失败]', err);
								}
							})
							.catch(err => {
								console.log('[失败2]', err);
							})
					}
				})
			}
			
		}
	}
</script>

<style>
	.login_info{
		background: rgba(0, 0, 0, 0.7);
		border-radius: 20rpx;
		color: white;
		position: fixed;
		bottom: 100rpx;
		left: 0;
		right: 0;
		margin: 30rpx 100rpx;
		display: flex;
		align-items: center;
		padding: 15rpx 20rpx;
		justify-content: space-between; 
		z-index: 99;
		
	}
</style>
